package other.her.paas.utils;


public class ResultVo<T> {

    /** 状态码 "状态码（200成功、500错误）"*/
    private Integer code;

    /** 提示信息 */
    private String msg;


    /** 响应数据 */
    private T data;

    public ResultVo(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public ResultVo(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static ResultVo success() {
        return new ResultVo(200, "", "");
    }

    public static ResultVo success(Object object) {
        return new ResultVo(200, "", object);
    }

    public static ResultVo error(String msg) {
        return new ResultVo(500, msg);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
